import request from "@/api/request.js";


export function creatNewChat(params) {
    return request.post("chat/createNewChat", params)
}

export function searchHistorySummary(params) {
    return request.post("chat/historySummary", params)
}

//查询聊天历史详情
export function searchChatHistoryDetail(params) {
    return request.post("chat/detail", params)
}


export function appendMessage(params) {
    return fetch(request.defaults.baseURL + "/chat/appendMessage",
        {
            method: "post",
            responseType: "stream",
            headers: {
                "Content-Type": "application/json"
            },
            body: JSON.stringify(params)
        });
}

export function deleteChatById(params) {
    return request.post(`chat/delete/${params.chatId}`)
}